home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.0 / card_16715.txt < prev    next >
Text File  |  1989-02-26  |  829b  |  37 lines

  1. -- card: 16715 from stack: in.0
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 2202
  5. -- name: VolumeName
  6.  
  7.  
  8. -- part contents for background part 10
  9. ----- text -----
  10. 5
  11.  
  12. -- part contents for background part 2
  13. ----- text -----
  14. --
  15. -- VolumeName -- given a file pathname, return the name of the volume
  16. -- it resides on. Straightforward string munging.
  17. --
  18. function VolumeName path
  19.   put empty into vol
  20.   repeat with i = 1 to the length of path
  21.     if character i of path is ":" then -- Stop at first colon
  22.       put ":" after vol
  23.       return vol
  24.     else
  25.       put character i of path after vol
  26.     end if
  27.   end repeat
  28.   
  29.   -- If we reach here, there's something drastically wrong.
  30.   answer "Bad path given to VolumeName" with "OK"
  31.   return empty
  32. end VolumeName
  33.  
  34.  
  35. -- part contents for background part 3
  36. ----- text -----
  37. VolumeName